package com.sds.prolog;

import com.google.inject.servlet.ServletModule;
import com.sds.prolog.dao.PrologDAO;
import com.sds.prolog.services.*;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class PrologModule extends ServletModule {
    @Override
    protected void configureServlets() {
        bind(EntityManagerFactory.class).toInstance(Persistence.createEntityManagerFactory("prolog-datasource"));
        bind(PrologDAO.class).asEagerSingleton();
        bind(PrologService.class).asEagerSingleton();
        bind(QuestionDaoService.class).asEagerSingleton();
        bind(RuleDaoService.class).asEagerSingleton();
        bind(LaptopDaoService.class).asEagerSingleton();
        bind(ReasoningService.class).asEagerSingleton();
        super.configureServlets();
    }
}
